// import { defaultconfig } from "../src/defaultconfig";

export async function getlocalpathfrombaseurl(u: string, baseurl: string) {
    if (u.startsWith(baseurl)) {
        const path = await import("path");
        const { fileURLToPath } = await import("url");
        var __dirname = path.resolve(
            path.dirname(fileURLToPath(import.meta.url))
        );
        const filepath = path.join(
            path.dirname(__dirname),
            u.slice(baseurl.length)
        );
        return filepath;
    } else {
        throw new Error("url is not startsWith baseurl");
    }
}
